<!--[*
// ----------------------------------------------------------------------
// Source file:  $Source: /cvsroot/pn-commerce/pn-commerce/pntemplates/pncommerce_user_userdata.html,v $
//
// Last changes from:  $Author: landseer $
//
// Revision:           $Revision: 1.12 $
//
// Date of revision    $Date: 2005/03/21 16:33:12 $
//
// ----------------------------------------------------------------------
//
// called from: pncommerce_user_userdata
// task: show the users data and let him change them if he wants to
*]-->

<!--[include file='pncommerce_user_commonHeader.html' ]-->
<!-- start userdata  -->

<!--[ pngetstatusmsg ]--><br>

<script type="text/javascript">
<!--
function populate(userinfo, selected) 
{

  var states = "<!--[ pnml name='_PNC_SELECTSTATE' ]-->,<!--[ pnml name='_PNC_USSTATES' ]-->";
  var stateArray = states.split(",");
  var provinces = "<!--[ pnml name='_PNC_SELECTPROVINCE' ]-->,<!--[ pnml name='_PNC_CAPROVINCES' ]-->";
  var provinceArray = provinces.split(",");

  var noArray = new Array("('--------------------','',true,true)");

  if (selected == '<!--[ pnml name='_PNC_USA' ]-->')
  {
    userinfo.invstate.style.display="inline";
    for (var i=0; i < stateArray.length; i++) 
    {
        if (stateArray[i] == "<!--[ $User.State ]-->")
        {
            newstate = new Option( stateArray[i], stateArray[i], true, true );
        }
        else
        {
            newstate = new Option( stateArray[i], stateArray[i], false, false );
        }
        userinfo.invstate.options[i] = newstate;
	}
	return;
  }

  if (selected == '<!--[ pnml name='_PNC_CANADA' ]-->') 
  {
    userinfo.invstate.style.display="inline";
    while (provinceArray.length < userinfo.invstate.options.length) 
    {
        userinfo.invstate.options[(userinfo.invstate.options.length - 1)] = null;
    }
    for (var i=0; i < provinceArray.length; i++) 
    {
        if (provinceArray[i] == "<!--[ $User.State ]-->")
        {
            newprovince = new Option( provinceArray[i], provinceArray[i], true, true );
        }
        else
        {
            newprovince = new Option( provinceArray[i], provinceArray[i], false, false );
        }
        userinfo.invstate.options[i] = newprovince;
	}
	return;
  }
  userinfo.invstate.style.display="none";
}

function populateShipTo(userinfo, selected) 
{

  var states = "<!--[ pnml name='_PNC_SELECTSTATE' ]-->,<!--[ pnml name='_PNC_USSTATES' ]-->";
  var stateArray = states.split(",");
  var provinces = "<!--[ pnml name='_PNC_SELECTPROVINCE' ]-->,<!--[ pnml name='_PNC_CAPROVINCES' ]-->";
  var provinceArray = provinces.split(",");

  var noArray = new Array("('--------------------','',true,true)");

  if (selected == '<!--[ pnml name='_PNC_USA' ]-->')
  {
    userinfo.ShipToState.style.display="inline";
    for (var i=0; i < stateArray.length; i++) 
    {
        if (stateArray[i] == "<!--[ $User.State ]-->")
        {
            newstate = new Option( stateArray[i], stateArray[i], true, true );
        }
        else
        {
            newstate = new Option( stateArray[i], stateArray[i], false, false );
        }
        userinfo.ShipToState.options[i] = newstate;
	}
	return;
  }

  if (selected == '<!--[ pnml name='_PNC_CANADA' ]-->') 
  {
    userinfo.ShipToState.style.display="inline";
    while (provinceArray.length < userinfo.ShipToState.options.length) 
    {
        userinfo.ShipToState.options[(userinfo.ShipToState.options.length - 1)] = null;
    }
    for (var i=0; i < provinceArray.length; i++) 
    {
        if (provinceArray[i] == "<!--[ $User.ShipToState ]-->")
        {
            newprovince = new Option( provinceArray[i], provinceArray[i], true, true );
        }
        else
        {
            newprovince = new Option( provinceArray[i], provinceArray[i], false, false );
        }
        userinfo.ShipToState.options[i] = newprovince;
	}
	return;
  }
  userinfo.ShipToState.style.display="none";
}

function init() {
   document.userdata.invcountry.onchange();
   document.userdata.shipcountry.onchange();
}
// this will be fired _after_ the window has loaded. We need this to find out the initial country and if we have to show states or provinces.
 window.onload = init;
//-->
</script>

<!--[ pncGetConfigSupplier ]-->

<form name="userdata" action="<!--[ pncUserModURL func=userdata ]-->" method="post" >
<input type='hidden' name='customerid' value='<!--[ $User.KID ]-->'>
<input type='hidden' name='authid' value='<!--[pnsecgenauthkey module="pncommerce"]-->'>

<!--[ pnml name='_PNC_YOURUSERDATA' html=1 ]-->
<br><br>
<table width="80%">

	<tr>
	    <td colspan='2' align='center'>
	        <b><!--[ pnml name='_PNC_INVOICEADDRESS' ]--></b>
	    </td>
	</tr>
	
	<tr>
	    <td colspan='2'>
	        &nbsp;
	    </td>
    </tr>
	
    <tr>
        <td ALIGN="right">
            
            <!--[ pnml name='_PNC_YOURNAME' ]-->:&nbsp;
            
        </td>
        <td ALIGN="left">
            <INPUT TYPE="text" NAME="invname" VALUE="<!--[ $User.Name ]-->" SIZE="40">
        </td>
    </tr>

    <tr>
        <td ALIGN="right">
            
            <!--[ pnml name='_PNC_YOURADDRESS' ]-->:&nbsp;
            
        </td>
        <td ALIGN="left">
            <INPUT TYPE="text" NAME="invaddress1" VALUE="<!--[ $User.Address1 ]-->" SIZE="40">
        </td>
    </tr>

    <tr>
        <td>&nbsp;
            
        </td>
        <td>
            <INPUT TYPE="text" NAME="invaddress2" VALUE="<!--[ $User.Address2 ]-->" SIZE="40">
        </td>
    </tr>

    <tr>
        <td ALIGN="right">
            
            <!--[ pnml name='_PNC_YOURCITYSTATEZIP' ]-->
            
        </td>

      <td ALIGN="left"> 
            <INPUT TYPE="text" NAME="invzip" VALUE="<!--[ $User.Zip ]-->" SIZE="7" MAXLENGTH="12">
            <INPUT TYPE="text" NAME="invcity" VALUE="<!--[ $User.City ]-->" SIZE="25">
            <select name="invstate" style="display: <!--[ if (($User.Country==$Canada)OR($User.Country==$USA)) ]-->inline<!--[ else ]-->none<!--[ /if ]-->;">
            <!--[* pncStateSelectlist SelectedState=$User.State Country=$User.Country *]-->
             <!--[ if ($User.Country) ]-->
                 <!--[ pncCountrySelectlist SelectedCountry=$User.Country ]-->
             <!--[ else ]-->
                 <!--[ pncCountrySelectlist SelectedCountry=$shopConfigSupplier.Country ]-->
             <!--[ /if ]-->
            </select>
      </td>
    </tr>
    
    <tr>
        <td ALIGN="right">
            
            <!--[ pnml name='_PNC_YOURCOUNTRY' ]-->
            
        </td>
		<td ALIGN="left">
            <select name="invcountry" onChange="populate(document.userdata,document.userdata.invcountry.options[document.userdata.invcountry.selectedIndex].value)">
            <!--[ pncCountrySelectlist SelectedCountry=$User.Country ]-->
            </select>

		</td>
    </tr>
	
	<tr>
	    <td ALIGN="right">
	        
	        <!--[ pnml name='_PNC_DAYTIMEPHONE' ]-->:&nbsp;
	        
	    </td>
	    <td ALIGN="left">
	        <INPUT TYPE="text" NAME="dayphone" VALUE="<!--[ $User.DayPhone ]-->" SIZE="40">
	    </td>
	</tr>
	
	<tr>
	    <td ALIGN="right">
	        
	        <!--[ pnml name='_PNC_EVENINGPHONE' ]-->:&nbsp;
	        
	    </td>
	    <td ALIGN="left">
	        <INPUT TYPE="text" NAME="evephone" VALUE="<!--[ $User.EvePhone ]-->" SIZE="40">
	    </td>
	</tr>

	<tr>
	    <td ALIGN="right">
	        
	        <!--[ pnml name='_PNC_YOUREMAIL' ]-->:&nbsp;
	        
	    </td>
	    <td ALIGN="left">
	        <INPUT TYPE="text" NAME="email" VALUE="<!--[ $User.Email ]-->" SIZE="40">
	    </td>
	</tr>

	<tr>
	    <td ALIGN="right">
	        
	        <!--[ pnml name='_PNC_LASTUSEDPAYMETHOD' ]-->:&nbsp;
	        
	    </td>
	    <td ALIGN="left">
	        <!--[ if $User.PayMethodInfo ]-->
	        <!--[ $User.PayMethodInfo ]-->
	        <!--[ else ]-->
	        <!--[ pnml name='_PNC_NOTAVAILABLE' ]-->
	        <!--[ /if ]-->
	    </td>
	</tr>

	<tr>
	    <td ALIGN="right">
	        
	        <!--[ pnml name='_PNC_LASTUSEDSHIPMETHOD' ]-->:&nbsp;
	        
	    </td>
	    <td ALIGN="left">
	        <!--[ if $User.ShipMethodInfo ]-->
	        <!--[ $User.ShipMethodInfo ]-->
	        <!--[ else ]-->
	        <!--[ pnml name='_PNC_NOTAVAILABLE' ]-->
	        <!--[ /if ]-->
	    </td>
	</tr>

	<tr>
	    <td colspan='2'>&nbsp;
	        
	    </td>
	</tr>

	<tr>
	    <td align="right">
	        <!--[ pnml name='_PNC_TAXEXEMPT' ]-->
	    </td>
	    <td>
	        <input type="checkbox" name="TaxExempt" value="checked" <!--[ $User.TaxExempt ]-->>&nbsp;
	    </td>
	</tr>

	<tr>
	    <td align="right">
	        <!--[ pnml name='_PNC_VATIDENTNUMBER' ]-->
	    </td>
	    <td>
	        <input type="text" name="VATIdentNumber" value=<!--[ $User.VATIdentnumber ]-->>
	    </td>
	</tr>
	
	<tr>
	    <td colspan='2'>&nbsp;
	        
	    </td>
	</tr>
	
	<tr>
	    <td colspan='2' align='center'>
	        <b><!--[ pnml name='_PNC_LASTUSEDSHIPPINGADDRESS' ]--></b>
	    </td>
	</tr>
	
	<tr>
	    <td colspan='2'>
	        &nbsp;
	    </td>
    </tr>
	
 	<tr>
 	    <td ALIGN="right">
 	        
 	        <!--[ pnml name='_PNC_SHIPTONAME' ]-->:&nbsp;
 	        
 	    </td>
	    <td ALIGN="left">
	        <input type="text" name="shipname" value="<!--[ $User.ShipToName ]-->" SIZE="40">
	    </td>
	</tr>
    
    <tr>
        <td ALIGN="right">
            
            <!--[ pnml name='_PNC_YOURADDRESS' ]-->:&nbsp;
            
        </td>
	    <td ALIGN="left">
	        <input type="text" name="shipaddress1" value="<!--[ $User.ShipToAddress1 ]-->" SIZE="40">
	    </td>
	</tr>
	
	<tr>
	    <td>&nbsp;
	        
	    </td>
	    <td>
	        <input type="text" name="shipaddress2" value="<!--[ $User.ShipToAddress2 ]-->" SIZE="40">
	    </td>
	</tr>
	
	<tr>
	    <td ALIGN="right">
	        
	        <!--[ pnml name='_PNC_YOURCITYSTATEZIP' ]-->
	        
	    </td>
      	<td ALIGN="left">
      	    <INPUT TYPE="text" NAME="shipzip" VALUE="<!--[ $User.ShipToZip ]-->" SIZE="7" MAXLENGTH="12">
      	    <INPUT TYPE="text" NAME="shipcity" VALUE="<!--[ $User.ShipToCity ]-->" SIZE="25">
            <select name="shipstate" style="display: <!--[ if (($User.ShipToCountry==$Canada)OR($User.ShipToCountry==$USA)) ]-->inline<!--[ else ]-->none<!--[ /if ]-->;">
            <!--[* pncStateSelectlist SelectedState=$User.ShipToState Country=$User.ShipToCountry *]-->
             <!--[ if ($User.ShipToCountry) ]-->
                 <!--[ pncCountrySelectlist SelectedCountry=$User.ShipToCountry ]-->
             <!--[ else ]-->
                 <!--[ pncCountrySelectlist SelectedCountry=$shopConfigSupplier.Country ]-->
             <!--[ /if ]-->
            </select>
      	</td>
   </tr>
    
    <tr>
        <td ALIGN="right">
            
            <!--[ pnml name='_PNC_YOURCOUNTRY' ]-->
            
        </td>
		<td ALIGN="left">
            <select name="shipcountry" onChange="populateShipTo(document.userdata,document.userdata.shipcountry.options[document.userdata.shipcountry.selectedIndex].value)">
            <!--[ pncCountrySelectlist SelectedCountry=$User.ShipToCountry ]-->
            </select>

		</td>

	</tr>
	
	<tr>
	    <td height='30' colspan="2" align="middle">
	        <input name='submit' type="submit" value="<!--[ pnml name='_PNC_SUBMIT' ]-->">
	   	</td>
	</tr>
</table>

</form>


<!-- end userdata -->
<!--[include file='pncommerce_user_commonFooter.html' ]-->
